package com.easymin.weixin.service.impl;

import com.easymin.weixin.entity.AllowAccessIp;
import com.easymin.weixin.entity.AllowAccessIpCriteria;
import com.easymin.weixin.mapper.AllowAccessIpMapper;
import com.easymin.weixin.mapper.BaseMapper;
import com.easymin.weixin.service.AllowAccessIpService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class DefaultAllowAccessIpService extends AbstractBaseService<AllowAccessIp, AllowAccessIpCriteria, Long> implements AllowAccessIpService {

  @Autowired
  private AllowAccessIpMapper allowAccessIpMapper;

  @Override
  public BaseMapper<AllowAccessIp, AllowAccessIpCriteria, Long> getMapper() {

    return allowAccessIpMapper;
  }


  @Override
  public int updateAll(String content) {
    AllowAccessIp allowAccessIp = new AllowAccessIp();
    allowAccessIp.setContent(content);
    allowAccessIp.setUpdated(new Date());

    AllowAccessIpCriteria allowAccessIpCriteria = new AllowAccessIpCriteria();
    allowAccessIpCriteria.createCriteria();

    return allowAccessIpMapper.updateByExampleWithBlobs(allowAccessIp, allowAccessIpCriteria);
  }
}
